﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>后台管理 - 易买网</title>
<link type="text/css" rel="stylesheet" href="../css/style.css" />
<script type="text/javascript" src="../scripts/function-manage.js"></script>
</head>
<body>
<%@include file="nav.jsp"%>
<div id="position" class="wrap">
	您现在的位置：<a href="index.jsp">易买网</a> &gt; 管理后台
</div>
<div id="main" class="wrap">
	<%@include file="left.jsp"%>
	<div class="main">
		<h2>新闻管理</h2>
		<div class="manage">
			<table class="list">
				<tr>
					<th>ID</th>
					<th>新闻标题</th>
					<th>操作</th>
				</tr>
				<c:forEach var="news" items="${list}">
					<tr>
						<td class="first w4 c">${news.en_id}</td>
						<td>${news.en_title}</td>
						<td class="w1 c">
							<a href="newsSelectById?id=${news.en_id}&pageIndex=${pageIndex}">修改</a>
							<a href="javascript:myDelete(${news.en_id},${pageIndex})">删除</a>
						</td>
					</tr>
				</c:forEach>

			</table>

			<div class="pager">
				<ul class="clearfix">
					<c:if test="${pageIndex !=1 }">
						<li><a href="newsSelectByPage?pageIndex=1">首页</a></li>
						<li><a href="newsSelectByPage?pageIndex=${pageIndex-1}">上一页</a></li>
					</c:if>

					<li class="current">${pageIndex}/${maxPage}</li>
					<c:if test="${pageIndex != maxPage}">
						<li><a href="newsSelectByPage?pageIndex=${pageIndex+1}">下一页</a></li>
						<li><a href="newsSelectByPage?pageIndex=${maxPage}">末页</a></li>
					</c:if>
				</ul>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2022 卓京教育 All Rights Reserved. 湘ICP证1001号
</div>
</body>
</html>

<script type="text/javascript">
	function myDelete(id,pageIndex) {
		if(confirm("确认要删除吗？")){
			window.location.href="newsDelete?id="+id+"&pageIndex="+pageIndex;
		}
	}
</script>
